package cn.wolfcode.crm.web.controller;


import cn.wolfcode.crm.page.PageResult;
import cn.wolfcode.crm.query.AttendanceQueryObject;
import cn.wolfcode.crm.service.IAttendanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("attendance")
public class AttendanceController {

    @Autowired
    private IAttendanceService attendanceService;


    @RequestMapping("")
    public String index() {

        return "attendance";
    }

    @RequestMapping("list")
    @ResponseBody
    public PageResult list(AttendanceQueryObject qo) {

        PageResult pageResult = attendanceService.query(qo);
        System.out.println(qo.getBeginDate()+"~~"+qo.getEndDate());
        return  pageResult;
    }
}